// 基类，所有角色状态的基类，提供基础功能和接口
using System.Diagnostics;
public abstract class CharacterState<T> where T : CharacterBase<T>
{
    protected T character;         // 角色控制器引用
    protected CharacterStateMachine<T> stateMachine; // 状态机引用
    public IInputSource iinputSource;
    public PlayerController Player { get; private set; }

    // 构造函数，传入角色和状态机
    public CharacterState(T character, CharacterStateMachine<T> stateMachine)
    {
        this.character = character;
        this.stateMachine = stateMachine;
        iinputSource = character.InputSource;
        if (character is PlayerController player)
        {
            Player = player;
        }
    }
    public int force { get; private set; }
    // 处理跳跃逻辑

    // 状态进入时调用
    public virtual void Enter() { }
    // 状态退出时调用
    public virtual void Exit() { }
    // 每帧逻辑（Update 里调用）
    public virtual void Update()
    {
        
     }
    // 每帧物理逻辑（FixedUpdate 里调用）
    public virtual void FixedUpdate() { }

}
